home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q32743 < prev    next >
Text File  |  1988-08-09  |  5KB  |  98 lines

  1. Q32743 _fmalloc and halloc Run-Time Library Update
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    The following is an application note describing the _fmalloc and
  8. halloc run-time library update.
  9.  
  10. More Information:
  11.    The _fmalloc (which is equivalent to malloc in large and compact
  12. models) run-time library functions that were released with Version
  13. 5.10 of the Microsoft C Optimizing Compiler impose an arbitrary limit
  14. of 4 megabyte as the amount of memory you can allocate in OS/2. In
  15. addition, the halloc run-time library routine impose a single
  16. allocation limit of 4 megabyte on memory requests.
  17.    The files described below can be used to replace existing modules
  18. in your libraries in order to overcome these limits. The new limit for
  19. _fmalloc is 16 megabytes, while the new limit on single allocations
  20. with halloc is a function of the operating system, i.e., you can
  21. allocate as much memory as OS/2 allows.
  22.    To update your libraries, copy all of the files listed below from
  23. the Software Library into the same directory as your libraries. Make
  24. sure that the library manager LIB.EXE also is in the current directory
  25. or in your PATH. You then can run the file LIBFIX.CMD to update your
  26. libraries. If you are running in DOS or in the DOS Compatibility Box
  27. in OS/2, you can run the LIBFIX.BAT batch file.
  28.    Note that LIBFIX.CMD and LIBFIX.BAT assume that your protect-mode
  29. combined libraries use the default naming convention, i.e., the
  30. protect-mode combined library names are of the form where X is the
  31. memory model (S,M,C,L) and Y is the floating point option (E,A,7), as
  32. follows:
  33.  
  34.    XLIBCYP.LIB
  35.  
  36.    For example, LIBFIX will attempt to update the file SLIBCEP.LIB,
  37. the small-model emulator library for protect mode. If your protect-mode
  38. combined libraries are not of the form given above, it will be
  39. necessary for you to update your libraries manually or else modify the
  40. .BAT or .CMD file so that the proper libraries are updated. A sample
  41. command line to the library manager is as follows:
  42.  
  43.    lib -+halloc.s -+crt0.s slibcep.lib ;
  44.  
  45.    This command line will update the small-model protect-mode combined
  46. library. If your protect-mode library has a different name (e.g.
  47. slibce.lib), you would use the following command line:
  48.  
  49.    lib -+halloc.s -+crt0.s slibce.lib ;
  50.  
  51.    It is not necessary to update the real-mode combined libraries because
  52. the fix to the libraries does not affect programs that use the real-mode
  53. libraries.
  54.    Please note that the library manager will create a backup of each
  55. library that it updates. Once you are satisfied that the update
  56. procedure is completed successfully, you can delete the files with the
  57. .BAK extension.
  58.    Below is a description of the files included with this application
  59. note. These files can be found in the Software Library by searching
  60. for the filename, the Q number of this article or S12001.
  61.  
  62.    halloc.txt   This file
  63.  
  64.    The following are replacement modules to correct the limit on
  65. halloc:
  66.  
  67.         halloc.s    halloc.obj for small model libraries
  68.         halloc.m    halloc.obj for medium model libraries
  69.         halloc.c    halloc.obj for compact model libraries
  70.         halloc.l    halloc.obj for large model libraries including
  71.                                multi-thread and dynamic link libraries
  72.  
  73.  
  74.    The following are replacement modules to correct the limit on
  75. _fmalloc:
  76.  
  77.         crt0.s      crt0.obj for small model libraries
  78.         crt0.m      crt0.obj for medium model libraries
  79.         crt0.c      crt0.obj for compact model libraries
  80.         crt0.l      crt0.obj for large model libraries
  81.         crt0.mt     crt0.obj for multi-thread support library LLIBMT.LIB
  82.         crt0.cdl    crt0.obj for multi-thread DLL library CDLLOBJS.LIB
  83.         csu.dll     crt0.obj for single thread DLL library LLIBCDLL.LIB
  84.  
  85.    If you are using _fmalloc and you require more than 16 megabytes of
  86. memory, you can edit the file BRKCTL.INC, which is included with the
  87. startup source code. Change the value MAXSEG_PM in this file and then
  88. rebuild the appropriate modules as outlined in the README.DOC that is
  89. included in the startup code directory. This value was originally 64;
  90. the CRT0.OBJ modules on this disk were assembled with the value of
  91. MAXSEG_PM set to 256.
  92.    If the startup code is not on your hard disk, you will need to go
  93. through the C Version 5.10 setup procedure again and choose the option
  94. to copy the startup code to your hard disk.
  95.  
  96. Keywords:  appnote softlib buglist5.10
  97. Updated  88/08/09 05:59
  98.